package arxivtests;

import org.junit.Test;
import org.junit.After;
import org.junit.Before;
import static org.junit.Assert.*;

import java.util.*;

import arxiv.Article;


public class ArticleTest {

    private Article myArticle;
    private List<String> authorList;

    @Before
    public void setUp() throws Exception {
        myArticle = new Article();
        myArticle.setTitle("Solving eigenvalue problems on curved surfaces using the Closest Point Method");
        authorList = new ArrayList<String>();
        authorList.add("Colin B. Macdonald");
        authorList.add("Jeremy Brandman");
        authorList.add("Steven J. Ruuth");
        myArticle.setAuthors(authorList);
    }

    @After
    public void tearDown() throws Exception {
        myArticle = null;
        authorList = null;
    }

    // testing setters and getters not necessary..
    @Test
    public void testGetAuthors() {
        assertEquals("[Colin B. Macdonald, Jeremy Brandman, Steven J. Ruuth]", myArticle.getAuthors().toString());
    }

    @Test
    public void testGetTitle() {
        assertEquals("Solving eigenvalue problems on curved surfaces using the Closest Point Method", myArticle.getTitle());
    }

    @Test
    public void testDisplay() {
        String toDisplay = "Title: Solving eigenvalue problems on curved surfaces using the Closest Point Method\nAuthors: [Colin B. Macdonald, Jeremy Brandman, Steven J. Ruuth]\n";
        assertEquals(toDisplay, myArticle.display());
    }

}
